package com.sky.utils;

import com.alibaba.fastjson.JSONObject;
import com.sky.bean.Message;

public class JsonHelper {

	public static String toJSONString(int code,String msg)
	{
		Message message = new Message();
		
		message.setCode(code);
		message.setMsg(msg);
		
		return JSONObject.toJSONString(message);
	}
	
	public static String toJSONString(int code,String msg,Object data)
	{
		Message message = new Message();
		
		message.setCode(code);
		message.setMsg(msg);
		message.setData(data);
		
		return JSONObject.toJSONString(message);
	}
}
